<?php

Route::group(['middleware' => ['web','auth:admin'], 'prefix' => 'shop', 'namespace' => 'Modules\Shop\Http\Controllers'], function()
{
    Route::get('/', 'ShopController@index');
    Route::resource('/category', 'CategoryController');
});

Route::group(['middleware' => ['web'],'prefix'=>'shop','namespace'=>"Modules\Shop\Http\Controllers"],
    function () {
        //前台列表路由
        Route::get('/lists/{cid}','HomeController@lists')->name('lists');
        //前台文章详情路由
        Route::get('/detail/{article}','HomeController@content')->name('detail');
    });
 
//article-route
Route::group(['middleware' => ['web', 'auth:admin'],'prefix'=>'shop','namespace'=>"Modules\Shop\Http\Controllers"], 
function () {
    Route::resource('article', 'ArticleController')->middleware("permission:admin,resource");
});

//评论路由组
Route::group(['middleware' => 'web','prefix'=>'shop','namespace'=>"Modules\Shop\Http\Controllers"],
    function () {
        Route::resource('comment', 'CommentController');
        //审核评论路由
        Route::get('/shenhe/{comment}','CommentController@shenhe')->name('shenhe');
    });